Ext.define('HGMIDE.controller.RotateScreenController', {
	extend : 'Ext.app.Controller',
	config : {
		refs : {
			runBtn : '#rotateScreenBtn'
		},
		control : {
			runBtn : {
				tap : 'doRotate'
			}
		}
	},
	doRotate : function() {
		var currentEmulatorScreen = EmulatorManager.currentEmulator;
		if (currentEmulatorScreen != null) {
			var id = EmulatorManager.currentEmulator.getId();
			var idNum = id.substring(id.indexOf('r') + 1);
			var emulatorObj = EmulatorManager
					.getEmulatorObj('emulator' + idNum);
			var pluginSideBtn = Ext.getCmp('pluginSideBtn' + idNum);
			var fullScreenBtn = Ext.getCmp('fullScreenBtn' + idNum);
			var list = Ext.getCmp('ide_plugin_manage_space');
			if (emulatorObj.isFullScreen) {
				emulatorObj.isFullScreen = false;
				fullScreenBtn.setCls('qpBtn');
				if (list.getHidden()) {
					pluginSideBtn.setCls('pluginSideBtn1');
				} else {
					pluginSideBtn.setCls('pluginSideBtn');
				}
				Util.btnTipText.setHtml(I18N.openFullscreen);
			}
			Emulator.rotateScreen(EmulatorManager.currentEmulator, emulatorObj);
		};
	}
});
